/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.adapter.driving.persistence.login.repository;

import com.lap.auth.adapter.driving.persistence.login.LoginLogConverter;
import com.lap.auth.adapter.driving.persistence.login.mapper.LoginLogMapper;
import com.lap.auth.adapter.driving.persistence.login.po.LoginLogPo;
import com.lap.auth.domain.login.LoginLog;
import com.lap.auth.domain.login.repository.LoginLogRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@RequiredArgsConstructor
@Repository
public class LoginLogRepositoryImpl implements LoginLogRepository {

  private final LoginLogConverter loginLogConverter;
  private final LoginLogMapper loginLogMapper;

  @Override
  public Integer save(LoginLog loginLog) {
    LoginLogPo loginLogPo = loginLogConverter.toPo(loginLog);
    loginLogMapper.insert(loginLogPo);
    return loginLogPo.getId();
  }
}
